package com.mallcloud.mall.common.core.constant.enums.app;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;

/**
 * 积分商品兑换
 */
@Getter
@AllArgsConstructor
public enum PointsProductRedeemEnum {

	//字典
	REDEEM_STATUS("REDEEM_STATUS", "积分兑换状态字典"),
	;

	private final String type;
	private final String description;

	@Getter
	@RequiredArgsConstructor
	public enum RedeemStatusEnum {
		Y("已领取"),
		N("未领取"),
		G("已过期"),
		Q("已取消"),
		T("已退货"),
		;
		private final String status;

		public static String getDecs(String code) {
			return Arrays.stream(values()).filter(x -> x.name().equals(code)).findFirst().get().getStatus();
		}
	}

}
